// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_MST_COMMON_ITEM
// * CreateDate    : 2013-08-28 11:00:56
// * Creater       : CodeSmith
// * LastChangeDate: 2013-08-28 11:00:56
// * LastChanger   : 2013-08-28 11:00:56
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Suzsoft.Smart.Data;
using ESOL.Common.Entity;

namespace ESOL.Business.Mst
{
/// <summary>
    /// MstCommonItem
    /// </summary>
    public partial class MstCommonItemBs
    {
        #region GetByID
        /// <summary>
        /// Get Entity
        /// </summary>
        /// <param name="objMstCommonItemEntity">Entity</param>
        /// <returns>Entity</returns>
        public static MstCommonItemEntity GetMstCommonItem(MstCommonItemEntity objMstCommonItemEntity)
        {
            return DataAccess.SelectSingle<MstCommonItemEntity>(objMstCommonItemEntity);
        }
        #endregion


        #region Insert
        /// <summary>
        /// Insert Data
        /// </summary>
        /// <param name="objMstCommonItemEntity">Entity</param>
        /// <returns>true Insert Succeed; false Insert Fail</returns>
        public static bool InsertMstCommonItem(MstCommonItemEntity objMstCommonItemEntity)
        {
            return DataAccess.Insert(objMstCommonItemEntity);
        }

        public static bool InsertMstCommonItem(List<MstCommonItemEntity> objMstCommonItemEntityList)
        {
            return DataAccess.Insert(objMstCommonItemEntityList);
        }
        #endregion


        #region Update
        /// <summary>
        /// Update Data
        /// </summary>
        /// <param name="objMstCommonItemEntity">Entity</param>
        /// <returns>true Update Succeed; false Update Fail</returns>
        public static bool UpdateMstCommonItem(MstCommonItemEntity objMstCommonItemEntity)
        {
            return DataAccess.Update(objMstCommonItemEntity);
        }

        public static bool UpdateMstCommonItem(List<MstCommonItemEntity> objMstCommonItemEntityList)
        {
            return DataAccess.Update<MstCommonItemEntity>(objMstCommonItemEntityList);
        }
        #endregion


        #region Delete
        /// <summary>
        /// Delete Data
        /// </summary>
        /// <param name="objMstCommonItemEntity">Entity</param>
        /// <returns>true Delete Succeed; false Delete Fail</returns>
        public static bool DeleteMstCommonItem(MstCommonItemEntity objMstCommonItemEntity)
        {
            return DataAccess.Delete(objMstCommonItemEntity);
        }

        public static bool DeleteMstCommonItem(List<MstCommonItemEntity> objMstCommonItemEntityList)
        {
            return DataAccess.Delete<MstCommonItemEntity>(objMstCommonItemEntityList);
        }
        #endregion


        #region GetAll
        /// <summary>
        /// Get All Data
        /// </summary>
        /// <returns>Back All Data<returns>
        public static DataSet GetMstCommonItemAll()
        {
            return DataAccess.SelectAllDataSet<MstCommonItemEntity>();
        }
        /// <summary>
        /// Get All Data List
        /// </summary>
        /// <returns>Back All Data List<returns>
        public static List<MstCommonItemEntity> GetMstCommonItemAllList()
        {
            return DataAccess.SelectAll<MstCommonItemEntity>();
        }
        #endregion


        #region Functions
        public static DataSet GetMstCItemByType(string itemType)
        {
            string sql = "select * from mst_common_item where item_type='"+itemType+"'";
            return DataAccess.SelectDataSet(sql);
        }

        public static List<MstCommonItemEntity> GetMstCItemList(MstCommonItemEntity e)
        {
            return DataAccess.Select<MstCommonItemEntity>(e);
        }

        #endregion
    }
	
	
}	

